3.1225 \(\int \frac{(a+b \tan (e+f x))^2}{(c+d \tan (e+f x))^3} \, dx\)

Optimal. Leaf size=221 \[ -\frac{\left (a^2 \left (-\left (3 c^2 d-d^3\right )\right )+2 a b c \left (c^2-3 d^2\right )+b^2 d \left (3 c^2-d^2\right )\right ) \log (c \cos (e+f x)+d \sin (e+f x))}{f \left (c^2+d^2\right )^3}-\frac{x \left (a^2 \left (-\left (c^3-3 c d^2\right )\right )-2 a b d \left (3 c^2-d^2\right )+b^2 c \left (c^2-3 d^2\right )\right )}{\left (c^2+d^2\right )^3}-\frac{(b c-a d)^2}{2 d f \left (c^2+d^2\right ) (c+d \tan (e+f x))^2}+\frac{2 (a c+b d) (b c-a d)}{f \left (c^2+d^2\right )^2 (c+d \tan (e+f x))} \]

[Out]

-(((b^2*c*(c^2 - 3*d^2) - 2*a*b*d*(3*c^2 - d^2) - a^2*(c^3 - 3*c*d^2))*x)/(c^2 + d^2)^3) - ((2*a*b*c*(c^2 - 3*
d^2) + b^2*d*(3*c^2 - d^2) - a^2*(3*c^2*d - d^3))*Log[c*Cos[e + f*x] + d*Sin[e + f*x]])/((c^2 + d^2)^3*f) - (b
*c - a*d)^2/(2*d*(c^2 + d^2)*f*(c + d*Tan[e + f*x])^2) + (2*(b*c - a*d)*(a*c + b*d))/((c^2 + d^2)^2*f*(c + d*T
an[e + f*x]))

________________________________________________________________________________________

Rubi [A]  time = 0.406876, antiderivative size = 221, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 4, integrand size = 25, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.16, Rules used = {3542, 3529, 3531, 3530} \[ -\frac{\left (a^2 \left (-\left (3 c^2 d-d^3\right )\right )+2 a b c \left (c^2-3 d^2\right )+b^2 d \left (3 c^2-d^2\right )\right ) \log (c \cos (e+f x)+d \sin (e+f x))}{f \left (c^2+d^2\right )^3}-\frac{x \left (a^2 \left (-\left (c^3-3 c d^2\right )\right )-2 a b d \left (3 c^2-d^2\right )+b^2 c \left (c^2-3 d^2\right )\right )}{\left (c^2+d^2\right )^3}-\frac{(b c-a d)^2}{2 d f \left (c^2+d^2\right ) (c+d \tan (e+f x))^2}+\frac{2 (a c+b d) (b c-a d)}{f \left (c^2+d^2\right )^2 (c+d \tan (e+f x))} \]

Antiderivative was successfully verified.

[In]

Int[(a + b*Tan[e + f*x])^2/(c + d*Tan[e + f*x])^3,x]

[Out]

-(((b^2*c*(c^2 - 3*d^2) - 2*a*b*d*(3*c^2 - d^2) - a^2*(c^3 - 3*c*d^2))*x)/(c^2 + d^2)^3) - ((2*a*b*c*(c^2 - 3*
d^2) + b^2*d*(3*c^2 - d^2) - a^2*(3*c^2*d - d^3))*Log[c*Cos[e + f*x] + d*Sin[e + f*x]])/((c^2 + d^2)^3*f) - (b
*c - a*d)^2/(2*d*(c^2 + d^2)*f*(c + d*Tan[e + f*x])^2) + (2*(b*c - a*d)*(a*c + b*d))/((c^2 + d^2)^2*f*(c + d*T
an[e + f*x]))

Rule 3542

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^2, x_Symbol] :> Simp[
((b*c - a*d)^2*(a + b*Tan[e + f*x])^(m + 1))/(b*f*(m + 1)*(a^2 + b^2)), x] + Dist[1/(a^2 + b^2), Int[(a + b*Ta
n[e + f*x])^(m + 1)*Simp[a*c^2 + 2*b*c*d - a*d^2 - (b*c^2 - 2*a*c*d - b*d^2)*Tan[e + f*x], x], x], x] /; FreeQ
[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && LtQ[m, -1] && NeQ[a^2 + b^2, 0]

Rule 3529

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[((
b*c - a*d)*(a + b*Tan[e + f*x])^(m + 1))/(f*(m + 1)*(a^2 + b^2)), x] + Dist[1/(a^2 + b^2), Int[(a + b*Tan[e +
f*x])^(m + 1)*Simp[a*c + b*d - (b*c - a*d)*Tan[e + f*x], x], x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c
 - a*d, 0] && NeQ[a^2 + b^2, 0] && LtQ[m, -1]

Rule 3531

Int[((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])/((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[((a*c +
 b*d)*x)/(a^2 + b^2), x] + Dist[(b*c - a*d)/(a^2 + b^2), Int[(b - a*Tan[e + f*x])/(a + b*Tan[e + f*x]), x], x]
 /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && NeQ[a*c + b*d, 0]

Rule 3530

Int[((c_) + (d_.)*tan[(e_.) + (f_.)*(x_)])/((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(c*Log[Re
moveContent[a*Cos[e + f*x] + b*Sin[e + f*x], x]])/(b*f), x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d,
0] && NeQ[a^2 + b^2, 0] && EqQ[a*c + b*d, 0]

Rubi steps

\begin{align*} \int \frac{(a+b \tan (e+f x))^2}{(c+d \tan (e+f x))^3} \, dx &=-\frac{(b c-a d)^2}{2 d \left (c^2+d^2\right ) f (c+d \tan (e+f x))^2}+\frac{\int \frac{a^2 c-b^2 c+2 a b d+\left (2 a b c-a^2 d+b^2 d\right ) \tan (e+f x)}{(c+d \tan (e+f x))^2} \, dx}{c^2+d^2}\\ &=-\frac{(b c-a d)^2}{2 d \left (c^2+d^2\right ) f (c+d \tan (e+f x))^2}+\frac{2 (b c-a d) (a c+b d)}{\left (c^2+d^2\right )^2 f (c+d \tan (e+f x))}+\frac{\int \frac{(a c+b c-a d+b d) (a c-b c+a d+b d)+2 (b c-a d) (a c+b d) \tan (e+f x)}{c+d \tan (e+f x)} \, dx}{\left (c^2+d^2\right )^2}\\ &=-\frac{\left (b^2 c \left (c^2-3 d^2\right )-2 a b d \left (3 c^2-d^2\right )-a^2 \left (c^3-3 c d^2\right )\right ) x}{\left (c^2+d^2\right )^3}-\frac{(b c-a d)^2}{2 d \left (c^2+d^2\right ) f (c+d \tan (e+f x))^2}+\frac{2 (b c-a d) (a c+b d)}{\left (c^2+d^2\right )^2 f (c+d \tan (e+f x))}-\frac{\left (2 a b c \left (c^2-3 d^2\right )+b^2 d \left (3 c^2-d^2\right )-a^2 \left (3 c^2 d-d^3\right )\right ) \int \frac{d-c \tan (e+f x)}{c+d \tan (e+f x)} \, dx}{\left (c^2+d^2\right )^3}\\ &=-\frac{\left (b^2 c \left (c^2-3 d^2\right )-2 a b d \left (3 c^2-d^2\right )-a^2 \left (c^3-3 c d^2\right )\right ) x}{\left (c^2+d^2\right )^3}-\frac{\left (2 a b c \left (c^2-3 d^2\right )+b^2 d \left (3 c^2-d^2\right )-a^2 \left (3 c^2 d-d^3\right )\right ) \log (c \cos (e+f x)+d \sin (e+f x))}{\left (c^2+d^2\right )^3 f}-\frac{(b c-a d)^2}{2 d \left (c^2+d^2\right ) f (c+d \tan (e+f x))^2}+\frac{2 (b c-a d) (a c+b d)}{\left (c^2+d^2\right )^2 f (c+d \tan (e+f x))}\\ \end{align*}

Mathematica [C]  time = 3.8701, size = 292, normalized size = 1.32 \[ -\frac{(b c-a d) \left (\frac{2 \left (a^2 \left (3 c^2 d-d^3\right )-2 a b c \left (c^2-3 d^2\right )+b^2 d \left (d^2-3 c^2\right )\right ) \log (c+d \tan (e+f x))}{\left (c^2+d^2\right )^2}-\frac{2 (a d-b c) \left (2 a c d+b \left (d^2-c^2\right )\right )}{d \left (c^2+d^2\right ) (c+d \tan (e+f x))}+\frac{(a+i b)^2 (d+i c)^3 \log (-\tan (e+f x)+i)}{\left (c^2+d^2\right )^2}+\frac{i (a-i b)^2 (c+i d) \log (\tan (e+f x)+i)}{(c-i d)^2}\right )+\frac{d^2 (a+b \tan (e+f x))^3}{(c+d \tan (e+f x))^2}-\frac{b d (a+b \tan (e+f x))^2}{c+d \tan (e+f x)}}{2 f \left (c^2+d^2\right ) (a d-b c)} \]

Antiderivative was successfully verified.

[In]

Integrate[(a + b*Tan[e + f*x])^2/(c + d*Tan[e + f*x])^3,x]

[Out]

-((d^2*(a + b*Tan[e + f*x])^3)/(c + d*Tan[e + f*x])^2 - (b*d*(a + b*Tan[e + f*x])^2)/(c + d*Tan[e + f*x]) + (b
*c - a*d)*(((a + I*b)^2*(I*c + d)^3*Log[I - Tan[e + f*x]])/(c^2 + d^2)^2 + (I*(a - I*b)^2*(c + I*d)*Log[I + Ta
n[e + f*x]])/(c - I*d)^2 + (2*(-2*a*b*c*(c^2 - 3*d^2) + b^2*d*(-3*c^2 + d^2) + a^2*(3*c^2*d - d^3))*Log[c + d*
Tan[e + f*x]])/(c^2 + d^2)^2 - (2*(-(b*c) + a*d)*(2*a*c*d + b*(-c^2 + d^2)))/(d*(c^2 + d^2)*(c + d*Tan[e + f*x
]))))/(2*(-(b*c) + a*d)*(c^2 + d^2)*f)

________________________________________________________________________________________

Maple [B]  time = 0.04, size = 753, normalized size = 3.4 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+b*tan(f*x+e))^2/(c+d*tan(f*x+e))^3,x)

[Out]

6/f/(c^2+d^2)^3*ln(c+d*tan(f*x+e))*a*b*c*d^2-3/f/(c^2+d^2)^3*ln(1+tan(f*x+e)^2)*a*b*c*d^2+6/f/(c^2+d^2)^3*arct
an(tan(f*x+e))*a*b*c^2*d-3/2/f*a^2/(c^2+d^2)^3*ln(1+tan(f*x+e)^2)*c^2*d-3/f*a^2/(c^2+d^2)^3*arctan(tan(f*x+e))
*c*d^2+3/f*a^2/(c^2+d^2)^3*ln(c+d*tan(f*x+e))*c^2*d-1/f/(c^2+d^2)^3*arctan(tan(f*x+e))*b^2*c^3-1/2/f/(c^2+d^2)
^3*ln(1+tan(f*x+e)^2)*b^2*d^3+1/f/(c^2+d^2)^3*ln(c+d*tan(f*x+e))*b^2*d^3-2/f*a^2/(c^2+d^2)^2/(c+d*tan(f*x+e))*
c*d+1/f*a^2/(c^2+d^2)^3*arctan(tan(f*x+e))*c^3-1/2/f*a^2/(c^2+d^2)*d/(c+d*tan(f*x+e))^2-1/f*a^2/(c^2+d^2)^3*ln
(c+d*tan(f*x+e))*d^3+1/2/f*a^2/(c^2+d^2)^3*ln(1+tan(f*x+e)^2)*d^3-2/f/(c^2+d^2)^3*arctan(tan(f*x+e))*a*b*d^3+3
/f/(c^2+d^2)^3*arctan(tan(f*x+e))*b^2*c*d^2-1/2/f/(c^2+d^2)/d/(c+d*tan(f*x+e))^2*c^2*b^2+2/f/(c^2+d^2)^2/(c+d*
tan(f*x+e))*a*b*c^2-2/f/(c^2+d^2)^2/(c+d*tan(f*x+e))*a*b*d^2+2/f/(c^2+d^2)^2/(c+d*tan(f*x+e))*b^2*c*d+3/2/f/(c
^2+d^2)^3*ln(1+tan(f*x+e)^2)*b^2*c^2*d-2/f/(c^2+d^2)^3*ln(c+d*tan(f*x+e))*a*b*c^3-3/f/(c^2+d^2)^3*ln(c+d*tan(f
*x+e))*b^2*c^2*d+1/f/(c^2+d^2)/(c+d*tan(f*x+e))^2*a*b*c+1/f/(c^2+d^2)^3*ln(1+tan(f*x+e)^2)*a*b*c^3

________________________________________________________________________________________

Maxima [A]  time = 1.74511, size = 562, normalized size = 2.54 \begin{align*} \frac{\frac{2 \,{\left (6 \, a b c^{2} d - 2 \, a b d^{3} +{\left (a^{2} - b^{2}\right )} c^{3} - 3 \,{\left (a^{2} - b^{2}\right )} c d^{2}\right )}{\left (f x + e\right )}}{c^{6} + 3 \, c^{4} d^{2} + 3 \, c^{2} d^{4} + d^{6}} - \frac{2 \,{\left (2 \, a b c^{3} - 6 \, a b c d^{2} - 3 \,{\left (a^{2} - b^{2}\right )} c^{2} d +{\left (a^{2} - b^{2}\right )} d^{3}\right )} \log \left (d \tan \left (f x + e\right ) + c\right )}{c^{6} + 3 \, c^{4} d^{2} + 3 \, c^{2} d^{4} + d^{6}} + \frac{{\left (2 \, a b c^{3} - 6 \, a b c d^{2} - 3 \,{\left (a^{2} - b^{2}\right )} c^{2} d +{\left (a^{2} - b^{2}\right )} d^{3}\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right )}{c^{6} + 3 \, c^{4} d^{2} + 3 \, c^{2} d^{4} + d^{6}} - \frac{b^{2} c^{4} - 6 \, a b c^{3} d + 2 \, a b c d^{3} + a^{2} d^{4} +{\left (5 \, a^{2} - 3 \, b^{2}\right )} c^{2} d^{2} - 4 \,{\left (a b c^{2} d^{2} - a b d^{4} -{\left (a^{2} - b^{2}\right )} c d^{3}\right )} \tan \left (f x + e\right )}{c^{6} d + 2 \, c^{4} d^{3} + c^{2} d^{5} +{\left (c^{4} d^{3} + 2 \, c^{2} d^{5} + d^{7}\right )} \tan \left (f x + e\right )^{2} + 2 \,{\left (c^{5} d^{2} + 2 \, c^{3} d^{4} + c d^{6}\right )} \tan \left (f x + e\right )}}{2 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*tan(f*x+e))^2/(c+d*tan(f*x+e))^3,x, algorithm="maxima")

[Out]

1/2*(2*(6*a*b*c^2*d - 2*a*b*d^3 + (a^2 - b^2)*c^3 - 3*(a^2 - b^2)*c*d^2)*(f*x + e)/(c^6 + 3*c^4*d^2 + 3*c^2*d^
4 + d^6) - 2*(2*a*b*c^3 - 6*a*b*c*d^2 - 3*(a^2 - b^2)*c^2*d + (a^2 - b^2)*d^3)*log(d*tan(f*x + e) + c)/(c^6 +
3*c^4*d^2 + 3*c^2*d^4 + d^6) + (2*a*b*c^3 - 6*a*b*c*d^2 - 3*(a^2 - b^2)*c^2*d + (a^2 - b^2)*d^3)*log(tan(f*x +
 e)^2 + 1)/(c^6 + 3*c^4*d^2 + 3*c^2*d^4 + d^6) - (b^2*c^4 - 6*a*b*c^3*d + 2*a*b*c*d^3 + a^2*d^4 + (5*a^2 - 3*b
^2)*c^2*d^2 - 4*(a*b*c^2*d^2 - a*b*d^4 - (a^2 - b^2)*c*d^3)*tan(f*x + e))/(c^6*d + 2*c^4*d^3 + c^2*d^5 + (c^4*
d^3 + 2*c^2*d^5 + d^7)*tan(f*x + e)^2 + 2*(c^5*d^2 + 2*c^3*d^4 + c*d^6)*tan(f*x + e)))/f

________________________________________________________________________________________

Fricas [B]  time = 1.62974, size = 1389, normalized size = 6.29 \begin{align*} -\frac{3 \, b^{2} c^{4} d - 10 \, a b c^{3} d^{2} + 2 \, a b c d^{4} + a^{2} d^{5} +{\left (7 \, a^{2} - 3 \, b^{2}\right )} c^{2} d^{3} - 2 \,{\left (6 \, a b c^{4} d - 2 \, a b c^{2} d^{3} +{\left (a^{2} - b^{2}\right )} c^{5} - 3 \,{\left (a^{2} - b^{2}\right )} c^{3} d^{2}\right )} f x -{\left (b^{2} c^{4} d - 6 \, a b c^{3} d^{2} + 6 \, a b c d^{4} - a^{2} d^{5} + 5 \,{\left (a^{2} - b^{2}\right )} c^{2} d^{3} + 2 \,{\left (6 \, a b c^{2} d^{3} - 2 \, a b d^{5} +{\left (a^{2} - b^{2}\right )} c^{3} d^{2} - 3 \,{\left (a^{2} - b^{2}\right )} c d^{4}\right )} f x\right )} \tan \left (f x + e\right )^{2} +{\left (2 \, a b c^{5} - 6 \, a b c^{3} d^{2} - 3 \,{\left (a^{2} - b^{2}\right )} c^{4} d +{\left (a^{2} - b^{2}\right )} c^{2} d^{3} +{\left (2 \, a b c^{3} d^{2} - 6 \, a b c d^{4} - 3 \,{\left (a^{2} - b^{2}\right )} c^{2} d^{3} +{\left (a^{2} - b^{2}\right )} d^{5}\right )} \tan \left (f x + e\right )^{2} + 2 \,{\left (2 \, a b c^{4} d - 6 \, a b c^{2} d^{3} - 3 \,{\left (a^{2} - b^{2}\right )} c^{3} d^{2} +{\left (a^{2} - b^{2}\right )} c d^{4}\right )} \tan \left (f x + e\right )\right )} \log \left (\frac{d^{2} \tan \left (f x + e\right )^{2} + 2 \, c d \tan \left (f x + e\right ) + c^{2}}{\tan \left (f x + e\right )^{2} + 1}\right ) - 2 \,{\left (b^{2} c^{5} - 4 \, a b c^{4} d + 6 \, a b c^{2} d^{3} - 2 \, a b d^{5} + 3 \,{\left (a^{2} - b^{2}\right )} c^{3} d^{2} -{\left (3 \, a^{2} - 2 \, b^{2}\right )} c d^{4} + 2 \,{\left (6 \, a b c^{3} d^{2} - 2 \, a b c d^{4} +{\left (a^{2} - b^{2}\right )} c^{4} d - 3 \,{\left (a^{2} - b^{2}\right )} c^{2} d^{3}\right )} f x\right )} \tan \left (f x + e\right )}{2 \,{\left ({\left (c^{6} d^{2} + 3 \, c^{4} d^{4} + 3 \, c^{2} d^{6} + d^{8}\right )} f \tan \left (f x + e\right )^{2} + 2 \,{\left (c^{7} d + 3 \, c^{5} d^{3} + 3 \, c^{3} d^{5} + c d^{7}\right )} f \tan \left (f x + e\right ) +{\left (c^{8} + 3 \, c^{6} d^{2} + 3 \, c^{4} d^{4} + c^{2} d^{6}\right )} f\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*tan(f*x+e))^2/(c+d*tan(f*x+e))^3,x, algorithm="fricas")

[Out]

-1/2*(3*b^2*c^4*d - 10*a*b*c^3*d^2 + 2*a*b*c*d^4 + a^2*d^5 + (7*a^2 - 3*b^2)*c^2*d^3 - 2*(6*a*b*c^4*d - 2*a*b*
c^2*d^3 + (a^2 - b^2)*c^5 - 3*(a^2 - b^2)*c^3*d^2)*f*x - (b^2*c^4*d - 6*a*b*c^3*d^2 + 6*a*b*c*d^4 - a^2*d^5 +
5*(a^2 - b^2)*c^2*d^3 + 2*(6*a*b*c^2*d^3 - 2*a*b*d^5 + (a^2 - b^2)*c^3*d^2 - 3*(a^2 - b^2)*c*d^4)*f*x)*tan(f*x
 + e)^2 + (2*a*b*c^5 - 6*a*b*c^3*d^2 - 3*(a^2 - b^2)*c^4*d + (a^2 - b^2)*c^2*d^3 + (2*a*b*c^3*d^2 - 6*a*b*c*d^
4 - 3*(a^2 - b^2)*c^2*d^3 + (a^2 - b^2)*d^5)*tan(f*x + e)^2 + 2*(2*a*b*c^4*d - 6*a*b*c^2*d^3 - 3*(a^2 - b^2)*c
^3*d^2 + (a^2 - b^2)*c*d^4)*tan(f*x + e))*log((d^2*tan(f*x + e)^2 + 2*c*d*tan(f*x + e) + c^2)/(tan(f*x + e)^2
+ 1)) - 2*(b^2*c^5 - 4*a*b*c^4*d + 6*a*b*c^2*d^3 - 2*a*b*d^5 + 3*(a^2 - b^2)*c^3*d^2 - (3*a^2 - 2*b^2)*c*d^4 +
 2*(6*a*b*c^3*d^2 - 2*a*b*c*d^4 + (a^2 - b^2)*c^4*d - 3*(a^2 - b^2)*c^2*d^3)*f*x)*tan(f*x + e))/((c^6*d^2 + 3*
c^4*d^4 + 3*c^2*d^6 + d^8)*f*tan(f*x + e)^2 + 2*(c^7*d + 3*c^5*d^3 + 3*c^3*d^5 + c*d^7)*f*tan(f*x + e) + (c^8
+ 3*c^6*d^2 + 3*c^4*d^4 + c^2*d^6)*f)

________________________________________________________________________________________

Sympy [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: AttributeError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*tan(f*x+e))**2/(c+d*tan(f*x+e))**3,x)

[Out]

Exception raised: AttributeError

________________________________________________________________________________________

Giac [B]  time = 1.52094, size = 829, normalized size = 3.75 \begin{align*} \frac{\frac{2 \,{\left (a^{2} c^{3} - b^{2} c^{3} + 6 \, a b c^{2} d - 3 \, a^{2} c d^{2} + 3 \, b^{2} c d^{2} - 2 \, a b d^{3}\right )}{\left (f x + e\right )}}{c^{6} + 3 \, c^{4} d^{2} + 3 \, c^{2} d^{4} + d^{6}} + \frac{{\left (2 \, a b c^{3} - 3 \, a^{2} c^{2} d + 3 \, b^{2} c^{2} d - 6 \, a b c d^{2} + a^{2} d^{3} - b^{2} d^{3}\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right )}{c^{6} + 3 \, c^{4} d^{2} + 3 \, c^{2} d^{4} + d^{6}} - \frac{2 \,{\left (2 \, a b c^{3} d - 3 \, a^{2} c^{2} d^{2} + 3 \, b^{2} c^{2} d^{2} - 6 \, a b c d^{3} + a^{2} d^{4} - b^{2} d^{4}\right )} \log \left ({\left | d \tan \left (f x + e\right ) + c \right |}\right )}{c^{6} d + 3 \, c^{4} d^{3} + 3 \, c^{2} d^{5} + d^{7}} + \frac{6 \, a b c^{3} d^{3} \tan \left (f x + e\right )^{2} - 9 \, a^{2} c^{2} d^{4} \tan \left (f x + e\right )^{2} + 9 \, b^{2} c^{2} d^{4} \tan \left (f x + e\right )^{2} - 18 \, a b c d^{5} \tan \left (f x + e\right )^{2} + 3 \, a^{2} d^{6} \tan \left (f x + e\right )^{2} - 3 \, b^{2} d^{6} \tan \left (f x + e\right )^{2} + 16 \, a b c^{4} d^{2} \tan \left (f x + e\right ) - 22 \, a^{2} c^{3} d^{3} \tan \left (f x + e\right ) + 22 \, b^{2} c^{3} d^{3} \tan \left (f x + e\right ) - 36 \, a b c^{2} d^{4} \tan \left (f x + e\right ) + 2 \, a^{2} c d^{5} \tan \left (f x + e\right ) - 2 \, b^{2} c d^{5} \tan \left (f x + e\right ) - 4 \, a b d^{6} \tan \left (f x + e\right ) - b^{2} c^{6} + 12 \, a b c^{5} d - 14 \, a^{2} c^{4} d^{2} + 11 \, b^{2} c^{4} d^{2} - 14 \, a b c^{3} d^{3} - 3 \, a^{2} c^{2} d^{4} - 2 \, a b c d^{5} - a^{2} d^{6}}{{\left (c^{6} d + 3 \, c^{4} d^{3} + 3 \, c^{2} d^{5} + d^{7}\right )}{\left (d \tan \left (f x + e\right ) + c\right )}^{2}}}{2 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*tan(f*x+e))^2/(c+d*tan(f*x+e))^3,x, algorithm="giac")

[Out]

1/2*(2*(a^2*c^3 - b^2*c^3 + 6*a*b*c^2*d - 3*a^2*c*d^2 + 3*b^2*c*d^2 - 2*a*b*d^3)*(f*x + e)/(c^6 + 3*c^4*d^2 +
3*c^2*d^4 + d^6) + (2*a*b*c^3 - 3*a^2*c^2*d + 3*b^2*c^2*d - 6*a*b*c*d^2 + a^2*d^3 - b^2*d^3)*log(tan(f*x + e)^
2 + 1)/(c^6 + 3*c^4*d^2 + 3*c^2*d^4 + d^6) - 2*(2*a*b*c^3*d - 3*a^2*c^2*d^2 + 3*b^2*c^2*d^2 - 6*a*b*c*d^3 + a^
2*d^4 - b^2*d^4)*log(abs(d*tan(f*x + e) + c))/(c^6*d + 3*c^4*d^3 + 3*c^2*d^5 + d^7) + (6*a*b*c^3*d^3*tan(f*x +
 e)^2 - 9*a^2*c^2*d^4*tan(f*x + e)^2 + 9*b^2*c^2*d^4*tan(f*x + e)^2 - 18*a*b*c*d^5*tan(f*x + e)^2 + 3*a^2*d^6*
tan(f*x + e)^2 - 3*b^2*d^6*tan(f*x + e)^2 + 16*a*b*c^4*d^2*tan(f*x + e) - 22*a^2*c^3*d^3*tan(f*x + e) + 22*b^2
*c^3*d^3*tan(f*x + e) - 36*a*b*c^2*d^4*tan(f*x + e) + 2*a^2*c*d^5*tan(f*x + e) - 2*b^2*c*d^5*tan(f*x + e) - 4*
a*b*d^6*tan(f*x + e) - b^2*c^6 + 12*a*b*c^5*d - 14*a^2*c^4*d^2 + 11*b^2*c^4*d^2 - 14*a*b*c^3*d^3 - 3*a^2*c^2*d
^4 - 2*a*b*c*d^5 - a^2*d^6)/((c^6*d + 3*c^4*d^3 + 3*c^2*d^5 + d^7)*(d*tan(f*x + e) + c)^2))/f